// 1feet = 0.3084m
// 1yard = 0.9144m
// 1mile = 1609.344m 
var feet2m = 0.3084;
var mile2m = 1609.344;
var m2feet = 3.28084;
var km2feet = 3280.84;
var mile2feet = 5280;
var psit2kPa = 6.890;
var psi2atm = 0.068;
var atm2psi = 14.70;
var mps2mph = 2.237;
var mph2mps =  0.44704;
var m2mile = 0.0006214;

//用于调试的变量
var debug = false;


// 用于查找的函数
function nolessthan(currentvalue){
    return currentvalue >= this;
}

// 已知(x1, y1), (x2, y2), x3, 求y3
// 如果x3 == x1, 返回值等于y1
function interpolate(x1, y1, x2, y2, x3){
    if(x1 == x2){
        error = 'in interpolate, x1==x2';
        return false;
    }
    return y1 + (y2 - y1) / (x2 - x1) * (x3 - x1);     
}

// 返回以10为底的对数值
function log10(x){
    return Math.log10(x);
}

// 去log10
function unlog10(x){
    return Math.pow(10, x);
}

if (typeof register == 'function') { register("public.js"); }